﻿
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/js/themes/default/easyui.css" />
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/js/themes/default/tree.css" />
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/js/themes/icon.css" />
		<link rel="stylesheet"
			href="${pageContext.request.contextPath}/css/ainit.css"
			type="text/css"></link>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.3.1.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/js/jquery.json-2.4.min.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/model/js/jquery.ainit-1.1.0.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/model/js/model.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/model/sysRight/userRight.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/model/sysRight/groupRight.js"></script>

		<script type="text/javascript">
	</script>
		<script type="text/javascript">
		$(function(){
			loadGroupCol(); //加载角色组列
			userToGroup();  //加载用户列
			userAllGroup();
			$('#tt').tabs({  
			    onSelect:function(title){  
			    	if(title == '角色内容'){
			    		tabGroupParm();
			    	}else if(title == '权限搜索'){
			    		var quBut = $('#seacQuGroup');
			    		searchGMGB(quBut,'0');
			    	}else{
			        }
			    }  
			});
			$("#loadQXdiv").hide();
		})
	</script>
	</head>

	<body class="easyui-layout" style="overflow-y: hidden">
		<div id='loadQXdiv'  style='height:100%;width:100%;background-color:white;z-index:99999 !important; position:absolute; filter:alpha(opacity=50);opacity: 
1;' align="center">
		  <img style="margin-top: 10%" id="planimg" src="${pageContext.request.contextPath}/model/images/08.gif" />
		  <br />
		  <span> <strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  努力加载中,请稍候...</strong></span>
		</div>
		<!-- 用layout 将左右分栏 -->
		<div data-options="region:'west' "
			style="width: 270px; height: 650px; overflow-y: hidden;"
			id="taskWest">
			<table cellpadding="0" cellspacing="0" style="padding-top: 5px;">
				<tr>
					<td colspan="2">
						<a class="easyui-linkbutton" href="#" onclick="addGroup(this)">添加角色组</a>
						<a class="easyui-linkbutton" href="#" onclick="saveGroup(this)">保存</a>
						<!-- 员工列表 -->
						<table id="groupList"></table>
					</td>
				</tr>
			</table>
		</div>
		<div data-options="region:'center'"
			style="height: 650px; padding-left: 1px;" id="cat_QueryTaskList">
			<div id="tt" class="easyui-tabs">
				<!-- 弄两个tablib -->
				<%--<div title="角色信息" style="overflow:auto;">  
			   	   <div style=" height:600px;">
			   	   	   <table class="tableBord" id="groupInfo" >
			   	   	   		<tr>
			   	   	   			<td colspan="2">
			   	   	   				<a class="easyui-linkbutton"  href="#" onclick="saveGroup(this)">保存</a>
			   	   	   				<input type="hidden" hd="T" name="groupId" qucln="GROUP_ID" vpk="T" />
			   	   	   			</td>
			   	   	   		</tr>
			   	   			<tr>
			   	   				<td class="name_td">角色组名称：</td>
			   	   				<td class="input_td">
			   	   					<input class="ainit-input" type="text" style="width: 128px; display: block;" iscopy="T" onchange="chan(this);" name="groupName" qucln="GROUP_NAME"/>
			   	   				</td>
			   	   			</tr>
			   	   			<tr>
			   	   				<td class="name_td">角色组等级：</td>
			   	   				<td class="input_td">
			   	   					<input class="ainit-input" type="text" style="width: 128px; display: block;" iscopy="T" onchange="chan(this);" name="groupLevel" qucln="GROUP_LEVEL"/>
			   	   				</td>
			   	   			</tr>
			   	   	   </table>
			   	   </div>
			   </div>--%>




				<div title="角色内容" style="overflow: auto;">
					<table>
						<tr>
							<td>
								<a class="easyui-linkbutton" href="#" onclick="saveGmgb()">保存</a>
							</td>
						</tr>
						<tr>
							<td id="allGroupPerms">
								<c:forEach items="${m.modelList}" var="mli">
									<!-- 循环模块这段动态生成所有权限 -->
									<div
										style="display: inline-block; zoom: 1; text-align: left; padding-top: 30px;">
										<div id="d_uid_22" style="width: 1200px;">
											<div class="caption-bar">
												<div class="collapse-button" onclick="closeP(this)"></div>
												<div class="caption">
													${mli.MEMO}
												</div>
												<div class="bar-right"></div>
											</div>
											<div class="body" style="position: relative;">
												<div class="d-container-ui-default"
													style="overflow: hidden; position: relative; text-align: left;">
													<table style="border-collapse: collapse; width: 1100px;">
														<tr>
															<!-- 这一段：加上3个列的名称 -->
															<td style="border: 2px solid #8db2e3; width: 140px">
																<div style="float: left;">
																	<input type="checkbox" onclick="chengeAllFunc(this)" />
																	<span onclick="checkboxSel(this,1)"
																		style="cursor: pointer;">全选/全取消</span>
																</div>
															</td>
															<td style="border: 2px solid #8db2e3; width: 200px">
																查询按钮
															</td>
															<td style="border: 2px solid #8db2e3;">
																详情按钮
															</td>
														</tr>
														<!-- 循环dsList -->
														<c:if test="${fn:length(m.dataStroeList)>0}">
															<c:forEach items="${m.dataStroeList}" var="dli">
																<!-- 循环：如果   子系统Id == 模块的子系统Id  -->
																<c:if test="${mli.SSID == dli.SSID}">
																	<tr gn='T'>
																		<!-- 动态加载：模块名称 -->
																		<td style="border: 1px solid #8db2e3;">
																			<!-- 将模块的相关属性如：名称、类别、等等填充过来 -->
																			<div style="float: left;">
																				<input type="checkbox" PAGE='T'
																					onclick="groupGNChange(1,this)" SSId='${dli.SSId}'
																					RTYPE='${dli.RTYPE }' MODULEID='${dli.MODULEID}' />
																				<span onclick="groupGNChange(2,this)"
																					style="cursor: pointer;">${dli.MEMO}:</span>
																			</div>
																		</td>
																		<!-- 动态加载：查询的按钮,又是一次循环 -->
																		<td style="border: 1px solid #8db2e3;">
																			<c:if test="${fn:length(m.butnList)>0}">
																				<c:forEach items="${m.butnList}" var="bl">
																					<!-- 循环butnList：如果  该模块的ds_id == 按钮的ds_id -->
																					<c:if test="${dli.MODULEID == bl.MODULEID }">
																						<div style="float: left;">
																							<input BTN='T' type="checkbox"
																								RTYPE='${bl.RTYPE }' SSId='${bl.SSId}'
																								MODULEID='${bl.MODULEID}' PAGEID='${bl.PAGEID }'
																								BTID='${bl.BTID }' comm='0' />
																							<span onclick="checkboxSel(this,3)"
																								style="cursor: pointer;">${bl.MEMO}</span>
																						</div>
																					</c:if>
																				</c:forEach>
																			</c:if>
																		</td>
																		<!-- 动态加载：详情的按钮,又是一次循环 -->
																		<td style="border: 1px solid #8db2e3;">
																			<c:if test="${fn:length(m.commButnList)>0}">
																				<c:forEach items="${m.commButnList}" var="cbl">
																					<c:if test="${dli.MODULEID  == cbl.MODULEID }">
																						<div style="float: left;">
																							<input BTN='T' type="checkbox"
																								onclick="groupButnChange(this)"
																								SSId='${cbl.SSId}' RTYPE='${cbl.RTYPE }'
																								MODULEID='${cbl.MODULEID}'
																								PAGEID='${cbl.PAGEID }' BTID='${cbl.BTID }'
																								comm='1' />
																							<span onclick="checkboxSel(this,3)" style="cursor: pointer;">${cbl.MEMO}</span>
																						</div>
																					</c:if>
																				</c:forEach>
																			</c:if>
																		</td>
																	</tr><!-- 结束整个表格 -->
																</c:if><!-- 结束一整个模块的按钮加载 -->
															</c:forEach><!-- 结束所有子系统的循环判断 -->
														</c:if>
													</table>
												</div>
											</div>
										</div>
									</div>
								</c:forEach>
							</td>
						</tr>
					</table>
				</div>
				<%--<div title="权限搜索" style="overflow:auto;">
					<div id="" style="width:800px;height: 600px;">
						<table>
							<tr>
								<td>
									 <div>
						  				条件查询:<input type="text" id="conGroupQu" onkeydown="if(event.keyCode==13) searchGMGB(this,1);"/>
						 			 </div>
								</td>
								<td>
									<a class="easyui-linkbutton" id="seacQuGroup"  href="#" onclick="searchGMGB(this,0)" >查询</a>
									<a class='easyui-linkbutton'  href='#' onclick='saveSeaGroupPerms()'>保存</a>
								</td>
							</tr>
						</table>
						<div id="seaDivGroup">   </div>
					</div>
				</div>--%>

				<div title="角色成员" style="overflow: auto;">
					<a href="javascript:void(0)" class="easyui-linkbutton c1"
						style="width: 60px; margin-bottom: 20px;" onclick=saveGRoupUser();>保存</a>
					<div class="easyui-layout" data-options="fit:true,border:false"
						style="height: 400px; width: 200px">
						<div region="north" title="查询条件" split="true"
							style="height: 60px;">
							姓名:
							<input type="text" id="o_name">
							部门:
							<select id="bumen">
								<option value="">
									全部
								</option>
								<c:forEach items="${m.allBuMen}" var="bm">
									<option value="${bm.MAN_ID}">
										${bm.M_NAME }
									</option>
								</c:forEach>

							</select>
							<a href="javascript:void(0)" class="easyui-link button c1"
								style="width: 60px; margin-bottom: 20px;"
								onclick=conditionQueryGoopUser();>查询</a>

						</div>
						<div
							data-options="region:'west',split:true,title:'拥有的人',collapsible:false"
							style="width: 400px;">
							<table id="userToGroup" class="easyui-datagrid"
								data-options="fit:true,border:false"></table>
						</div>

						<div data-options="region:'center'" align="center"
							vertical-align:middle; style="width: 200px;">
							<a href="javascript:void(0)" class="easyui-linkbutton c1"
								style="width: 60px; margin-bottom: 20px;" onclick=moveIn();>《
								移入</a>
							<a href="javascript:void(0)" class="easyui-linkbutton c5"
								style="width: 60px" onclick=moveOut();>移出 》</a>
						</div>


						<div
							data-options="region:'east',split:true,title:'未拥有的人',collapsible:false"
							style="width: 400px;">
							<table id="allUser" class="easyui-datagrid"
								data-options="fit:true,border:false"></table>
						</div>
					</div>
				</div>
				<%--<div title="数据范围"  style="overflow:auto; ">  
					<div style="height:620px;border: 1px solid #99BBE8;">
				       <!-- 加载所有的菜单 -->
				        <div id="leftModelData" style="float: left; width:100px; height:100%; border-right: 1px solid #99BBE8;"  >
<!--				        	<c:forEach items="${m.modelList}" var="mlist" >-->
<!--					      		<div style=" cursor: pointer;" flag='0' onclick="selMoForAllDs(this)" mId='${mlist.menuId }'>-->
<!--						      		<p><img src="../model/images/jindu-no.png" />${mlist.menuName}</p>-->
<!--					      		</div>  -->
<!--				      		</c:forEach>-->
				        </div>
				        <div style="height: 100%;">
				        	<div id="dsDataSql" style="height: 92%;"><!--  border-bottom: 1px solid #99BBE8; -->
				        		<div id="dsByleftData" style="height:60%; border-bottom: 1px solid #99BBE8;"><!-- 加载ds -->
				        		
				        		</div>
				        		<div style="height: 20px;" >
									<span style="">原始SQL：</span>
								</div> 
				        		<div id="sqlRight">
				        			<textarea rows="4" cols="170" id="sqlTextDS" readonly="readonly"></textarea>
				        		</div>
				        		<div style="height: 20px; " >
									<span style="">SQL条件输入框：</span>
								</div> 
				        		<div id="sqlRight">
				        			<textarea rows="4" cols="170" id="sqlTextArea"></textarea>
				        		</div>
				        	</div>
				        	<div style="padding-left: 10px; padding-top: 3px;border-bottom: 1px solid #99BBE8;">
				   	    		<a class='easyui-linkbutton' href="#" onclick="saveWhereSql()">保存</a>
				   	   	 	</div>
				        </div>
			   	    </div>
			   </div>--%>

			</div>

		</div>
		<input type="hidden" id='zab_sq_pks' />
		<input type="hidden" id="zab_dsId" value="${m.dsId}" />
	</body>
</html>